import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * Created by qiangjindong
 * 2018-08-25 09:38
 */
public class Main {

    public static void main(String[] args) {
        // 通过应用上下文创建和组装
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("spring-config.xml");
        Person person = context.getBean(Person.class);
        System.out.println(person);
        System.out.println(new Person(1));
    }

    void traditional() {
        Person person = new Person(18);
        person.setName("zs");
        person.introduce();
    }
}
